package engine.gui;

import engine.game.Manager;
import engine.graphics.TextureManager;
import engine.graphics.Vertex2f;
import engine.objects.TexturedObject;

public class GameButton extends Button{

	private static final long serialVersionUID = 1L;

	public GameButton(Manager m, int x, int y, int w, int h) {
		super(m, x, y, w, h);
		init(); 
	}
	
	public GameButton(Manager m, ParentObject parent, int w, int h) {
		this(m, (int)parent.getMinX(), (int)parent.getMinY(), w, h);
	}

	public void init(){
		super.init();  
		GameButton.textureButton(this); 
	}

	public void render(){
		if(this.isTextured())
			TextureManager.bindTexture("gui") ; 
		super.render(); 
	}
		
	public static void textureButton(GameButton gameButton) {
//		gameButton.subdivide(3, 30, NORMAL_TEXTURE, "gui", 
//				new Vertex2f[]{new Vertex2f(0,0)}); 
//		gameButton.border = new GameButtonBorder(gameButton.getManager(), gameButton);
		TexturedObject.addNewAnimationToObject(gameButton, NORMAL_TEXTURE, "gui", 
					new Vertex2f[]{new Vertex2f(300,30)},
					new Vertex2f[]{new Vertex2f(0,0)}, 0); 
	}
	

}
